#include<stdio.h>
typedef long long ll;
int main()
{
    ll n,cnt=0,i;
    scanf("%lld",&n);
    ll dp[100000];
    dp[0]=1,dp[1]=2,dp[2]=3;
    for(i=3;;++i)
    {
        dp[i]=dp[i-1]+dp[i-2];
        if(dp[i]>n) break;
    }
    ll ans;
    for(i=1;;++i)
    {
    if(n>=dp[i]) ans=i;
    else break;
    }
    printf("%lld",ans);
    return 0;
}